Two phase lock